

def updata_r(r,x):
    a, b = 3.57, 4.0
    u =  (a + (b-a) * (r - a + x) % (b - a)) % b
    return u